import request from '@/utils/http'

export class UserService {
  // 登录
  static login(params: Api.Auth.LoginParams) {
    return request.post<Api.Auth.LoginResponse>({
      url: '/auth/login',
      params
      // showErrorMessage: false // 不显示错误消息
    })
  }

  // 获取用户信息
  static getUserInfo() {
    return request.get<Api.User.UserInfo>({
      url: '/sys/user/info'
    })
  }

  static pages(params:any) {
    return request.post<any>({
      url: '/sys/user/pages',
  	params
    })
  }
  
  static getRoleIds(id: string) {
    return request.get<any>({
      url: '/sys/user/'+id+'/roleIds',
    })
  }
  
  static save(params:any) {
    return request.post<any>({
      url: '/sys/user/save',
  	params
    })
  }
  
  static delete(id:string) {
    return request.del<any>({
      url: '/sys/user/detain/'+id,
    })
  }
  
  static batchDelete(params:any) {
    return request.post<any>({
		url: '/sys/user/del/users',
		params
    })
  }
  
}
